HAL CORTEX SYSTICK functions migration

Note

The SYSTICK migration is applicable with all STM32 series.

HAL_SYSTICK_Config

HAL1

HAL2

The function HAL_SYSTICK_Config is responsible for configuring the SysTick timer to generate an interrupt at a specified number of ticks using TicksNumb:

This function has been updated and renamed to HAL_CORTEX_SYSTICK_SetFreq:

Functionality Update:

  • Replace Ticks_num (expressed in time) by ticks_freq (expressed in frequency).

uint32_t HAL_SYSTICK_Config(uint32_t TicksNumb)
hal_status_t HAL_CORTEX_SYSTICK_SetFreq(uint32_t ticks_freq);
Related use cases:

HAL_SYSTICK_CLKSourceConfig

HAL1

HAL2

The function HAL_SYSTICK_CLKSourceConfig was responsible for configuring the clock source for the SysTick timer:

This function has been updated and renamed to HAL_CORTEX_SYSTICK_SetClockSource:

Functionality Update:

  • Use specific enumeration hal_cortex_systick_clk_src_t for the clock source parameter, enhancing type safety and clarity.

void HAL_SYSTICK_CLKSourceConfig(uint32_t CLKSource)
void HAL_CORTEX_SYSTICK_SetClkSource(hal_cortex_systick_clk_src_t clk_src)

HAL_SYSTICK_GetCLKSourceConfig

HAL1

HAL2

The function HAL_SYSTICK_GetCLKSourceConfig was responsible for returning the current SysTick clock source.

This function has been removed, the current SysTick clock source is read directly from CMSIS.

HAL_SYSTICK_IRQHandler

HAL1

HAL2

the function HAL_SYSTICK_IRQHandler is responsible for handling SysTick timer interrupt requests:

This function has been renamed to HAL_CORTEX_SYSTICK_IRQHandler:

void HAL_SYSTICK_IRQHandler(void)
void HAL_CORTEX_SYSTICK_IRQHandler(void)

HAL_SYSTICK_Callback

HAL1

HAL2

The function HAL_SYSTICK_Callback was responsible for providing a user-defined callback function for SysTick timer interrupts:

This function has been renamed to HAL_CORTEX_SYSTICK_Callback:

void HAL_SYSTICK_Callback(void)
void HAL_CORTEX_SYSTICK_Callback(void)